3.50 \(\int \frac{\tan (c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=33 \[ -\frac{1}{2 d (a+i a \tan (c+d x))}-\frac{i x}{2 a} \]

[Out]

((-I/2)*x)/a - 1/(2*d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0263502, antiderivative size = 33, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.091, Rules used = {3526, 8} \[ -\frac{1}{2 d (a+i a \tan (c+d x))}-\frac{i x}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Tan[c + d*x]/(a + I*a*Tan[c + d*x]),x]

[Out]

((-I/2)*x)/a - 1/(2*d*(a + I*a*Tan[c + d*x]))

Rule 3526

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^m)/(2*a*f*m), x] + Dist[(b*c + a*d)/(2*a*b), Int[(a + b*Tan[e + f*x])^(m + 1),
 x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\tan (c+d x)}{a+i a \tan (c+d x)} \, dx &=-\frac{1}{2 d (a+i a \tan (c+d x))}-\frac{i \int 1 \, dx}{2 a}\\ &=-\frac{i x}{2 a}-\frac{1}{2 d (a+i a \tan (c+d x))}\\ \end{align*}

Mathematica [A]  time = 0.0942524, size = 45, normalized size = 1.36 \[ \frac{(1-2 i d x) \tan (c+d x)-2 d x+i}{4 a d (\tan (c+d x)-i)} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[c + d*x]/(a + I*a*Tan[c + d*x]),x]

[Out]

(I - 2*d*x + (1 - (2*I)*d*x)*Tan[c + d*x])/(4*a*d*(-I + Tan[c + d*x]))

________________________________________________________________________________________

Maple [B]  time = 0.02, size = 58, normalized size = 1.8 \begin{align*}{\frac{{\frac{i}{2}}}{ad \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{4\,ad}}+{\frac{\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{4\,ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(d*x+c)/(a+I*a*tan(d*x+c)),x)

[Out]

1/2*I/d/a/(tan(d*x+c)-I)-1/4/d/a*ln(tan(d*x+c)-I)+1/4/d/a*ln(tan(d*x+c)+I)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.25195, size = 90, normalized size = 2.73 \begin{align*} \frac{{\left (-2 i \, d x e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(-2*I*d*x*e^(2*I*d*x + 2*I*c) - 1)*e^(-2*I*d*x - 2*I*c)/(a*d)

________________________________________________________________________________________

Sympy [A]  time = 0.45862, size = 66, normalized size = 2. \begin{align*} \begin{cases} - \frac{e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text{for}\: 4 a d e^{2 i c} \neq 0 \\x \left (- \frac{\left (i e^{2 i c} - i\right ) e^{- 2 i c}}{2 a} + \frac{i}{2 a}\right ) & \text{otherwise} \end{cases} - \frac{i x}{2 a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise((-exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(4*a*d*exp(2*I*c), 0)), (x*(-(I*exp(2*I*c) - I)*exp(-2*I*c)/(
2*a) + I/(2*a)), True)) - I*x/(2*a)

________________________________________________________________________________________

Giac [B]  time = 1.36091, size = 78, normalized size = 2.36 \begin{align*} -\frac{\frac{\log \left (\tan \left (d x + c\right ) - i\right )}{a} - \frac{\log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} - \frac{\tan \left (d x + c\right ) + i}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/4*(log(tan(d*x + c) - I)/a - log(-I*tan(d*x + c) + 1)/a - (tan(d*x + c) + I)/(a*(tan(d*x + c) - I)))/d